﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;


//CreateBy          : Max
//CreateDateTime    : 2014/9/4
//Desc              : 精灵的抽象类

namespace BodBody.Sprites
{
    public abstract class AbsSprite
    {
        protected int currentElapsed;
        protected int secondsPerFrame = 60;

        private void Update(GameTime gameTime)
        {
            GameInput(Keyboard.GetState());            
            currentElapsed = currentElapsed + gameTime.ElapsedGameTime.Milliseconds;
            if ((this.currentElapsed > this.secondsPerFrame))
            {
                this.currentElapsed = 0;
                Updater(gameTime);
            }
        }

        protected virtual void Updater(GameTime gameTime) {
            
        }

        protected virtual void GameInput(KeyboardState keyboardState) {
            
        }
    }
}
